import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/',
      name: 'index',
      redirect: '/index/main',
      component: () =>
        import(/* webpackChunkName: "index" */ './views/index.vue'),
      children: [
        {
          path: '/index/main',
          name: 'index-main',
          meta: {
            label: '首页面板',
            keepAlive: true
          },
          components: {
            main: () =>
              import(/* webpackChunkName: "index" */ './views/index/main.vue')
          }
        },
        /* 试卷信息管理 */
        {
          path: '/article/index',
          name: 'article-index',
          meta: {
            label: '试卷信息',
            keepAlive: true
          },
          components: {
            main: () =>
              import(/* webpackChunkName: "article" */ './views/article/index.vue')
          }
        },
        {
          path: '/article/edit',
          name: 'article-edit',
          meta: {
            label: '试卷答案',
            keepAlive: true
          },
          components: {
            main: () =>
              import(/* webpackChunkName: "article" */ './views/article/edit.vue')
          }
        },
        // 修改承诺书
        {
          path: '/commitment/edit',
          name: 'commitment-index',
          meta: {
            label: '修改承诺书',
            keepAlive: true
          },
          components: {
            main: () =>
              import(/* webpackChunkName: "artsort" */ './views/commitment/edit.vue')
          }
        },
        // 添加通知
        {
          path: '/notice/add',
          name: 'notice-add',
          meta: {
            label: '添加通知',
            keepAlive: true
          },
          components: {
            main: () =>
              import(/* webpackChunkName: "artsort" */ './views/notice/add.vue')
          }
        },
        /* 添加人员 */
        {
          path: '/member/add',
          name: 'member-add',
          meta: {
            label: '人员信息管理',
            keepAlive: true
          },
          components: {
            main: () =>
              import(/* webpackChunkName: "member" */ './views/member/add.vue')
          }
        },
        /* 人员信息管理 */
        {
          path: '/member/index',
          name: 'member-index',
          meta: {
            label: '人员信息管理',
            keepAlive: true
          },
          components: {
            main: () =>
              import(/* webpackChunkName: "member" */ './views/member/index.vue')
          }
        },
        // 教师考试信息
        {
          path: '/teacher/index',
          name: 'teacher-index',
          meta: {
            label: '教师考试信息',
            keepAlive: true
          },
          components: {
            main: () =>
              import(/* webpackChunkName: "member" */ './views/teacher/index.vue')
          }
        },
        /* 考务系统资料 */
        {
          path: '/admin/index',
          name: 'admin-index',
          meta: {
            label: '用户资料',
            keepAlive: true
          },
          components: {
            main: () =>
              import(/* webpackChunkName: "system" */ './views/admin/index.vue')
          }
        },
        // 上传文件管理
        {
          path: '/docmangement/add',
          name: 'docmangement-add',
          meta: {
            label: '上传资源',
            keepAlive: true
          },
          components: {
            main: () =>
              import(/* webpackChunkName: "system" */ './views/docmangement/add.vue')
          }
        },
        {
          path: '/docmangement/mangement',
          name: 'docmangement-mangement',
          meta: {
            label: '管理资源',
            keepAlive: true
          },
          components: {
            main: () =>
              import(/* webpackChunkName: "system" */ './views/docmangement/mangement.vue')
          }
        },
        // 添加考试信息
        {
          path: '/exam/index',
          name: 'exam-index',
          meta: {
            label: '考试管理',
            keepAlive: true
          },
          components: {
            main: () =>
              import(/* webpackChunkName: "system" */ './views/exam/index.vue')
          }
        },
        // 添加考试信息
        {
          path: '/exam/manage',
          name: 'exam-index',
          meta: {
            label: '试卷',
            keepAlive: true
          },
          components: {
            main: () =>
              import(/* webpackChunkName: "system" */ './views/exam/manage.vue')
          }
        },
        // 添加试卷
        {
          path: '/exam/paper/index',
          name: 'paper-index',
          meta: {
            label: '添加试卷',
            keepAlive: true
          },
          components: {
            main: () =>
              import(/* webpackChunkName: "system" */ './views/paper/edit.vue')
          }
        },
        // 修改操作说明
        {
          path: '/modify/description',
          name: 'modify-description',
          meta: {
            label: '修改操作管理',
            keepAlive: true
          },
          components: {
            main: () =>
              import(/* webpackChunkName: "system" */ './views/modify/description.vue')
          }
        },
        /* 日志管理 */
        {
          path: '/logsys/index',
          name: 'logsys-index',
          meta: {
            label: '系统日志',
            keepAlive: true
          },
          components: {
            main: () =>
              import(/* webpackChunkName: "log" */ './views/logsys/index.vue')
          }
        },
        {
          path: '/logmember/index',
          name: 'logmember-index',
          meta: {
            label: '用户日志',
            keepAlive: true
          },
          components: {
            main: () =>
              import(/* webpackChunkName: "log" */ './views/logmember/index.vue')
          }
        },
        /* 消息提醒 */
        {
          path: '/message/edit',
          name: 'message-edit',
          meta: {
            label: '消息提醒',
            keepAlive: true
          },
          components: {
            main: () =>
              import(/* webpackChunkName: "message" */ './views/message/edit.vue')
          }
        },
        {
          path: '/view/view',
          name: 'view-qualification',
          meta: {
            label: '查看资格',
            keepAlive: true
          },
          components: {
            main: () =>
              import(/* webpackChunkName: "artsort" */ './views/view/view.vue')
          }
        },
        // 审核监考教师资格
        {
          path: '/check/check',
          name: 'check-qualification',
          meta: {
            label: '审查资格',
            keepAlive: true
          },
          components: {
            main: () =>
              import(/* webpackChunkName: "artsort" */ './views/check/check.vue')
          }
        },
        {
          path: '/teacher/state',
          name: 'teacher-state',
          meta: {
            label: '审查资格',
            keepAlive: true
          },
          components: {
            main: () =>
              import(/* webpackChunkName: "artsort" */ './views/teacher/state.vue')
          }
        },
        {
          path: '/teacher/process',
          name: 'teacher-process',
          meta: {
            label: '学习进度',
            keepAlive: true
          },
          components: {
            main: () =>
              import(/* webpackChunkName: "artsort" */ './views/teacher/process.vue')
          }
        },
        {
          path: '/check/test',
          name: 'check-test',
          meta: {
            label: '查看考场分布',
            keepAlive: true
          },
          components: {
            main: () =>
              import(/* webpackChunkName: "artsort" */ './views/check/test.vue')
          }
        }
      ]
    },
    {
      path: '/login',
      name: 'login',
      component: () =>
        import(/* webpackChunkName: "login" */ './views/login.vue')
    },
    {
      path: '*',
      name: 'four04',
      meta: {
        keepAlive: true
      },
      component: () =>
        import(/* webpackChunkName: "404" */ './views/404/index.vue')
    }
  ]
})
